package com.example.pc.videodemo.emq.model.answer

import com.example.pc.videodemo.emq.model.EmqConstant
import com.example.pc.videodemo.emq.MqttManager
import com.example.pc.videodemo.emq.Subscriber


class AnswerSubscriber : Subscriber() {
    override val emq: EmqConstant.serverToAndroidEnum
        get() = EmqConstant.serverToAndroidEnum.answer

    override fun onReceived(contents: String?) {
        val verifyWeighReceiveBean = gson.fromJson(contents, AnswerReceiveBeanBase::class.java)
        if (verifyWeighReceiveBean.sn == MqttManager.instance?.getSn())
            MqttManager.instance?.onReceivedData(verifyWeighReceiveBean)
    }
}